package com.breakfast.fun.data.entity.home;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by hp on 2016/8/22.
 */
public class CityData {

    /**
     * id : 2
     * cityName : 厦门市
     * addTime : 2015-10-17 09:42:43
     * state : 0
     * areaNum : 14
     * shopNum : 1
     * builderNum : 376
     * sort : 2
     */

    private int id;
    private String cityName;
    private String addTime;
    private int state;
    private int areaNum;
    private int shopNum;
    private int builderNum;
    private int sort;

    public static CityData objectFromData(String str) {

        return new Gson().fromJson(str, CityData.class);
    }

    public static List<CityData> arrayCityDataFromData(String str) {

        Type listType = new TypeToken<ArrayList<CityData>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getAddTime() {
        return addTime;
    }

    public void setAddTime(String addTime) {
        this.addTime = addTime;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public int getAreaNum() {
        return areaNum;
    }

    public void setAreaNum(int areaNum) {
        this.areaNum = areaNum;
    }

    public int getShopNum() {
        return shopNum;
    }

    public void setShopNum(int shopNum) {
        this.shopNum = shopNum;
    }

    public int getBuilderNum() {
        return builderNum;
    }

    public void setBuilderNum(int builderNum) {
        this.builderNum = builderNum;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }
}
